<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>创建节点</title>
</head>
<body>
    
    <script>
    
        {
            // 创建节点

            function createNode (n) {
                let drag = document.createDocumentFragment();
                for(let i=0;i<n;i++){
                    let div = document.createElement('div');
                    drag.appendChild(div);
                }
                document.body.appendChild(drag);   
            }
            createNode(5);

        }

        

    </script>

</body>
</html>